from rest_framework import serializers
from users.models import User
from django.contrib.auth.hashers import make_password

class UserSerialzer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = [
            'id',
            'username',
            'mobile',
            'email',
            'password'
        ]
        def create(self,validated_data):
            return User.objects.create_superuser(**validated_data)